chore(deps): update dependency sveltekit-superforms to v2 #1774
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^0.8.7
->^2.0.0
Release Notes
ciscoheat/sveltekit-superforms (sveltekit-superforms)
v2.0.0
Compare Source
Removed
superForm.fields
was a rarely used and lesser version offormFieldProxy
, switch to that instead.fields
options when setting tainted status.message
parameter inonError
event, use$message
directly instead.Changed
sveltekit-superforms/adapters
and usesuperValidate(zod(schema))
instead ofsuperValidate(schema)
. If type parameters are used, it must now be wrapped withInfer
for schemas.superForm
options now follow SvelteKit more closely:resetForm: true
andtaintedMessage: false
are default now. Adddefine: { SUPERFORMS_LEGACY: true }
invite.config.ts
to keep the old behavior.superValidateSync
is renamed todefaults
. It returns default values for the schema, and does no validation anymore. Use+page.ts
if initial validation is required, as described on the SPA page.arrayProxy
:fieldErrors
renamed tovalueErrors
.superformClient
adapter. The input for the validator functions can now beundefined
.superValidate
is called with just the schema, the default values aren't validated (i.e. no side-effects for default values) unlesserrors
is set totrue
.required
in their constraints anymore.undefined
anymore, must bestring
. (Set automatically by default now).flashMessage.onError.message
option insuperForm
renamed toflashMessage.onError.flashMessage
.constraints
are now optional in theSuperValidated
type, and are returned only when loading data, not posting. This is only relevant if you modify constraints before callingsuperForm
.defaultValidators
option,'clear'
can now be set directly onvalidators
instead.emptyIfZero
setting fromnumberProxy
andintProxy
.validate()
called with no arguments is renamed tovalidateForm()
and can take two extra options,update
andschema
.Added
dataType: 'json'
set.superForm.isTainted(path?)
andsuperForm.isTainted($tainted)
for better tainted fields check.withFiles
when returning in form actions:return withFiles({ form })
.File
andFileList
.superForm
object (previously only theform
store was accepted), with an extrataint
option to prevent tainting.taintedMessage
can now be an async function resolving totrue
if navigation should be allowed, despite the form being tainted.onChange
event tosuperForm
, that returns a list of modified fields whenever$form
is updated.'zero'
to the empty option ofnumberProxy
andintProxy
. Also addedinitiallyEmptyIfZero
option, to show the placeholder for numeric inputs, which would otherwise display0
.v1.13.4
Compare Source
Fixed
setError
didn't show up when submitting the form with an enter keypress.v1.13.3
Compare Source
Fixed
$form
whennull
. (#311)v1.13.2
Compare Source
Fixed
FormPathType
in top export.v1.13.1
Compare Source
Fixed
v1.13.0
Compare Source
Added
strict
option added tosuperValidate
, to ensure that all schema fields exist. In the default non-strict mode, non-existing fields are automatically using their default value. (#295, thanks to 21RISK for the PR)Fixed
v1.12.0
Compare Source
Added
Fixed
novalidate
attribute now only disables the browser validation constraints, not the entire client-side validation. (#297)onError
. Status will always be 500 though. (#292)v1.11.0
Compare Source
Added
fieldErrors
store is added to arrayProxy, so field errors (for items in the array, not the array itself) can be accessed.Fixed
false
oruntaint-all
, client-side validation was prevented.novalidate
andformnovalidate
attributes on forms and buttons weren't respected. (#287)v1.10.2
Compare Source
Fixed
v1.10.1
Added
arrayProxy
, for proxying arrays and their errors in the form data.FormPathArrays
type, enumerating all arrays in an object as string accessors. Used to accessarrayProxy
in a type-safe manner.formFieldProxy
now has ataint
option, in case a modification should not taint the form.v1.9.0
Compare Source
Added
app.d.ts
, by declaring namespaceApp.Superforms
with atype Message
, status messages will always be set to that type. (#261)FormResult<T>
, which can be used in onResult to make the ActionResult strongly typed.collapsed
prop, to make it initially collapsed. Use together withcollapsible
. (#279)Fixed
transform
operations weren't applied in SPA forms and when posting to the server with client-side validators enabled.v1.8.0
Compare Source
Fixed
Added
tainted
.v1.7.4
Compare Source
Fixed
v1.7.3
Compare Source
Fixed
v1.7.2
Compare Source
Fixed
submit-only
as validationMethod. (#270)submit-only
andonblur
as validationMethod.v1.7.1
Compare Source
Fixed
v1.7.0
Compare Source
Fixed
formFieldProxy
when using a strongly typed status message. (#260)Added
preprocessed
option to superValidate, for handling the processing/coercion of posted form fields manually.v1.6.1
Compare Source
Fixed
v1.6.0
Compare Source
Fixed
Added
cookieOptions
toactionResult
, for customizing the cookie when setting a flash message.collapsible
prop, that will make the component collapsible on a per-route basis.v1.5.3
Compare Source
Fixed
nonempty
).select
,textarea
andbutton
, not justinput
.v1.5.2
Compare Source
Fixed
v1.5.1
Compare Source
Fixed
v1.5.0
Compare Source
Fixed
false
value when posted, it was coerced astrue
.Added
customValidity
option tosuperForm
, which will use the browser's validation message reporting for validation errors. More information and an example here.emptyIfZero
option tonumberProxy
andintProxy
.v1.4.0
Compare Source
Fixed
superForm
instantiation, not just when new form data is received.Date
schema fields. (#232)numberProxy
andintProxy
now works with theempty
option. (#232)Added
delimiter
option tonumberProxy
.v1.3.0
Compare Source
Fixed
$page
in combination withonDestroy
. (#164, thank you to everyone in that thread!)dataType
option isn't set to'json'
and the schema contains a nested object. (#225)Added
v1.2.0
Compare Source
Added
scrollToError
option can now take the same parameters as scrollIntoView, which makes it work for nested scrollbars.setError
signature, to more conveniently set a form-level error:setError(form, 'Form-level error message')
Fixed
resetForm
option was enabled, the form was reset even iffail
was returned.v1.1.3
Compare Source
Fixed
setError
.v1.1.2
Compare Source
Added
v1.1.1
Compare Source
A quick-fix for the Set feature in 1.1.0.
Fixed
v1.1.0
Compare Source
Added
Set
in schemas, usingz.set()
.Fixed
true
always returnedtrue
when validating.message
. (#143, thanks to Alisson Cavalcante Agiani)v1.0.0
Compare Source
Changed
superForm
anymore, aSuperValidated
structure is required, which is returned fromsuperValidate
on the server andsuperValidateSync
, so in most cases this is not a problem.message/setMessage
andsetError
can only set a status in the range400-599
.refine/superRefine/transform
, array and object validation now forces the whole Zod schema to be validated client-side, not just per field.Validation
type is now calledSuperValidated
.StringPath
andStringPathLeaves
are renamed toFormPath
andFormPathLeaves
.Removed
valid
option is removed frommessage
, any status >= 400 will return a fail.$valid
,$empty
and$firstError
stores are removed from the client, they weren't that useful.allErrors
can be used instead, together with the$posted
store.empty
is removed fromSuperForm
.options.noErrors
is removed. Useoptions.errors
instead.meta
has been removed. Use the Zod schema directly instead for reflection.Fixed
onDestroy
.error
was thrown.setError
, using an empty string as path.id
for multiple forms is not required anymore when usinguse:enhance
, unless the forms are using the same schema. An id can be specified in the options or in a hidden form field called__superform_id
.FieldPath
is gone - the following methods are now using a string accessor liketags[2].id
instead of an array like['tags', 2, 'id']
:validate
,setError
and all proxy methods (ending withProxy
). This also applies to generic components.allErrors
andfirstError
has changed to{ path: string; messages: string[] }
."any"
is now an allowed value instep
for constraints.regex
andstep
are now allowed on a schema field. A warning will be emitted by default, that can be turned off.options.resetForm
has changed toboolean | () => boolean
(it was async before).defaultData
is now calleddefaultValues
.[aria-invalid="true"]
toerrorSelector
option.options.resetForm
now works withoutuse:enhance
!use:enhance
.Added
superValidateSync
, useful in components for SPA:s.defaultValues
, which takes a schema and returns the default values for it.ZodPipeline
.field._errors
in the$errors
store.validate
will now validate the whole form when it's called with no arguments.passthrough()
on a schema,superValidate
will allow extra keys in that case.posted
store, a boolean which is false if the form hasn't been posted during its current lifetime.reset
now has an additionaldata
option that can be used to re-populate the form with data, andid
to set a different form id.intProxy
,numberProxy
,dateProxy
andstringProxy
now have anempty
option, so empty values can be set tonull
orundefined
.Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.